<ion-header>

  <ion-navbar>
    <ion-title>{{isCheckedDatas.length==0?'批量派工':'已选择'+isCheckedDatas.length+'项'}}</ion-title>
    <ion-buttons end>
      <button ion-button icon-only class="font_size_large" (click)="checkedAllOrAllno()">{{isCheckedDatas.length!=datas.length?'全选':'全不选'}}</button>
    </ion-buttons>
  </ion-navbar>

</ion-header>


<ion-content (ionScroll)="scrollContent()">
  <ion-refresher (ionRefresh)="refresh($event)" pullMax="300" [enabled]="IS_APP">
    <ion-refresher-content
      pullingText="下拉刷新"
      refreshingSpinner="circles"
      refreshingText="正在刷新...">
    </ion-refresher-content>
  </ion-refresher>
  <div class="w12" style="padding-bottom:60px;">
    <div class="w12 font_size_large bgcolor_white mb10 mbatch_dispatch" *ngFor="let data of datas; let i = index">
      <div class="cart_pro_check" [class.xuan]="data.isChecked" (click)="checkClick(data)">
        <div class="circle"></div>
      </div>
      <ion-item>
        <ion-label class="text_hide_none font_size_large">
          <div class="w12 font_weight_bold">
            <span class="font_white  font_size_standard bgcolor_blue plr5 mr5 lh20">{{data.DESCRIPTION}}</span>
            <i class="fa fa-map-marker mr5" style="color:#347eff;"></i>{{data.ADDRESS}}
          </div>
          <span class="w08 mt5">{{data.NAME}} / {{data.MOBILE}}</span>
          <span class="w04 mt5 fr tr font_gray">{{data.DISTANCE!='0'?(data.DISTANCE|distance):''}}</span>
          <span class="w08 mt5">{{data.ID}}</span>
          <span class="w04 mt5 fr tr font_gray font_size_standard">{{data.THRUTIME}}  {{data.YYSJD}}</span>
          <span class="w12 mt5 font_black_666" *ngIf="data.GDLY">订单来源:{{data.GDLY}}</span>
          <span class="w12 mt5 font_black_666">{{data.ORDERID}}</span>
          <span class="w12 mt5 font_black_666 font_size_standard">备注:{{data.BZ?data.BZ:'无'}}</span>
        </ion-label>
      </ion-item>
      <ion-item *ngFor="let pro of data.CSM_SORDERITEM">
        <ion-label class="mt10 mb10 text_hide_none">
          <span class="w10">{{pro.EXTSKUNAME}}</span>
          <span class="w02 tr font_gray">× {{pro.NUM}}</span>
        </ion-label>
      </ion-item>
    </div>
    <div *ngIf="datasConfig.isEnd==true" class="w12 mt20 mb20 tc font_gray">
      ------------------------ 已经到底了 ------------------------
    </div>
    <ion-infinite-scroll (ionInfinite)="getMoreDatas($event)" threshold="100px" [enabled]="!datasConfig.isEnd">
      <ion-infinite-scroll-content loadingSpinner="bubbles" loadingText="数据加载中...">
      </ion-infinite-scroll-content>
    </ion-infinite-scroll>
  </div>
  <ion-fab bottom right mode="ios" *ngIf="canScrollToTop" class="mb50">
    <button ion-fab mini color="light" mode="ios" (click)="content.scrollToTop()">
      <ion-icon name="md-arrow-round-up"></ion-icon>
    </button>
  </ion-fab>
</ion-content>
<ion-footer>
  <div class="mbatch_footer">
    <button (click)="dispatch()">派单</button>
    <button (click)="grabOrders()">抢单派工</button>
  </div>
</ion-footer>
